<template>
  <a-tabs v-model:activeKey="activeKey" type="card">
    <a-tab-pane key="1" tab="题型选择" force-render>
      <QuestList :examList="examList" @handleExam="handleExam" />
    </a-tab-pane>

    <a-tab-pane key="2" tab="问卷大纲" force-render>
      <OutLine :contentList="contentList" @handleExam="handleExam" />
    </a-tab-pane>
  </a-tabs>
</template>
<script lang="ts">
import { QuestType } from '@/store/design/types';
import { defineComponent, ref } from 'vue';
import QuestList from '@/components/design/QuestList.vue';
import OutLine from '@/components/design/OutLine.vue';

export default defineComponent({
  components: { QuestList, OutLine },
  props: {
    /** 题目列表 */
    examList: { type: Array, default: () => [] },
    /** 问卷类型 */
    type: { type: Number, default: 1 },
    /** 题列表 */
    contentList: { type: Array, default: () => [] },
  },
  emits: [/** 点击天机题型 */ 'handleExam'],
  setup(props, { emit }) {
    const handleExam = (value: QuestType) => {
      emit('handleExam', value);
    };
    return { activeKey: ref('1'), handleExam };
  },
});
</script>
<style lang="less" scoped></style>
